package cn.nhic.web.filter;
import cn.nhic.web.constant.Constants;
import org.apache.commons.lang3.StringUtils;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletRequestWrapper;
import java.io.UnsupportedEncodingException;
import java.util.Map;

/**
 * @author duweiping
 * @date 2024/9/6 23:31
 */
public class CharacterRequest extends HttpServletRequestWrapper {
    HttpServletRequest request;

    public CharacterRequest(HttpServletRequest request) {
        super(request);
        this.request = request;
    }


    @Override
    public String getParameter(String name) {
        return super.getParameter(name);
    }


    @Override
    public Map<String, String[]> getParameterMap() {

        return super.getParameterMap();
    }


    private String convertCharSet(String origin) {
        if (StringUtils.isBlank(origin)) {
            return origin;
        }

        try {
            return new String(origin.getBytes(Constants.CharSetEnum.ISO_8859_1.getCharSet()), Constants.CharSetEnum.UTF_8.getCharSet());
        } catch (UnsupportedEncodingException e) {
            e.printStackTrace();
        }

        return origin;
    }
}
